-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Support for custom SSH port for KVM hosts from the host url on add host and the configuration #12571
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: 4.20
Are you sure you want to change the base?
Conversation
…m.host.discovery.ssh.port' - Use the custom SSH port for KVM host discovery to connect to the Host during Add Host command - and any other operations on host using SSH
|
@blueorangutan package |
|
@sureshanaparti a [SL] Jenkins job has been kicked to build packages. It will be bundled with KVM, XenServer and VMware SystemVM templates. I'll keep you posted as I make progress. |
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## 4.20 #12571 +/- ##
==========================================
Coverage 16.26% 16.27%
- Complexity 13428 13435 +7
==========================================
Files 5660 5662 +2
Lines 499959 500098 +139
Branches 60707 60732 +25
==========================================
+ Hits 81326 81369 +43
- Misses 409560 409650 +90
- Partials 9073 9079 +6
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
|
Packaging result [SF]: ✔️ el8 ✔️ el9 ✔️ el10 ✔️ debian ✔️ suse15. SL-JID 16684 |
|
@blueorangutan test |
|
@sureshanaparti a [SL] Trillian-Jenkins test job (ol8 mgmt + kvm-ol8) has been kicked to run smoke tests |
|
[SF] Trillian test result (tid-15362)
|
engine/components-api/src/main/java/com/cloud/agent/AgentManager.java
Outdated
Show resolved
Hide resolved
DaanHoogland
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
clgtm
…that port if passed, other fall back to config 'kvm.host.discovery.ssh.port')
|
@blueorangutan package |
|
@sureshanaparti a [SL] Jenkins job has been kicked to build packages. It will be bundled with KVM, XenServer and VMware SystemVM templates. I'll keep you posted as I make progress. |
weizhouapache
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@sureshanaparti
thanks for the update
just a minor comment: there are two method getHostSshPort, can one of them be removed ?
|
Packaging result [SF]: ✔️ el8 ✔️ el9 ✔️ el10 ✔️ debian ✔️ suse15. SL-JID 16772 |
@weizhouapache better in hostdao, but adding circular dependency with AgentManager. any other thoughts? |
@sureshanaparti |
updated @weizhouapache |
|
@blueorangutan package |
|
@sureshanaparti a [SL] Jenkins job has been kicked to build packages. It will be bundled with KVM, XenServer and VMware SystemVM templates. I'll keep you posted as I make progress. |
c2de55c to
5347dce
Compare
|
@blueorangutan package |
|
@sureshanaparti a [SL] Jenkins job has been kicked to build packages. It will be bundled with KVM, XenServer and VMware SystemVM templates. I'll keep you posted as I make progress. |
engine/orchestration/src/main/java/com/cloud/agent/manager/AgentManagerImpl.java
Outdated
Show resolved
Hide resolved
engine/orchestration/src/main/java/com/cloud/agent/manager/AgentManagerImpl.java
Outdated
Show resolved
Hide resolved
|
@blueorangutan package |
|
@sureshanaparti a [SL] Jenkins job has been kicked to build packages. It will be bundled with KVM, XenServer and VMware SystemVM templates. I'll keep you posted as I make progress. |
|
Packaging result [SF]: ✔️ el8 ✔️ el9 ✔️ el10 ✔️ debian ✔️ suse15. SL-JID 16781 |
|
@blueorangutan test |
|
@sureshanaparti a [SL] Trillian-Jenkins test job (ol8 mgmt + kvm-ol8) has been kicked to run smoke tests |
api/src/main/java/org/apache/cloudstack/api/command/admin/host/AddHostCmd.java
Outdated
Show resolved
Hide resolved
| String hostPort = host.getDetail(Host.HOST_SSH_POST); | ||
| int sshPort; | ||
| if (StringUtils.isBlank(hostPort)) { | ||
| sshPort = KVMHostDiscoverySshPort.valueIn(host.getClusterId()); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just to double check, in case the setting does not have a value on the cluster, will this method return the global set value, or the default value? It should honor the global value, only in case it is not set either, then use default value (22)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yes @nvazquez, when cluster config is not set, it picks from global (which is defaulted to 22).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good, thanks @sureshanaparti
| return KVMHostDiscoverySshPort.value(); | ||
| } | ||
|
|
||
| _hostDao.loadDetails(host); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should there be any check for the host hypervisor type? I think this should be only for KVM
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this method is called for KVM hypervisor only now, anyways added check to return default ssh port as 22 for other hypervisors.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great, thanks
|
[SF] Trillian test result (tid-15428)
|
|
@blueorangutan package |
|
@sureshanaparti a [SL] Jenkins job has been kicked to build packages. It will be bundled with KVM, XenServer and VMware SystemVM templates. I'll keep you posted as I make progress. |
|
Packaging result [SF]: ✔️ el8 ✔️ el9 ✔️ el10 ✔️ debian ✔️ suse15. SL-JID 16798 |
|
@blueorangutan test |
|
@nvazquez a [SL] Trillian-Jenkins test job (ol8 mgmt + kvm-ol8) has been kicked to run smoke tests |
winterhazel
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
CLGTM
| String HOST_INSTANCE_CONVERSION = "host.instance.conversion"; | ||
| String HOST_OVFTOOL_VERSION = "host.ovftool.version"; | ||
| String HOST_VIRTV2V_VERSION = "host.virtv2v.version"; | ||
| String HOST_SSH_POST = "host.ssh.port"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| String HOST_SSH_POST = "host.ssh.port"; | |
| String HOST_SSH_PORT = "host.ssh.port"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
good spot. I think this is an easy win, @sureshanaparti.
| int sshPort; | ||
| if (StringUtils.isBlank(hostPort)) { | ||
| sshPort = KVMHostDiscoverySshPort.valueIn(host.getClusterId()); | ||
| } else { | ||
| sshPort = Integer.parseInt(hostPort); | ||
| } | ||
|
|
||
| return sshPort; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| int sshPort; | |
| if (StringUtils.isBlank(hostPort)) { | |
| sshPort = KVMHostDiscoverySshPort.valueIn(host.getClusterId()); | |
| } else { | |
| sshPort = Integer.parseInt(hostPort); | |
| } | |
| return sshPort; | |
| if (StringUtils.isBlank(hostPort)) { | |
| return KVMHostDiscoverySshPort.valueIn(host.getClusterId()); | |
| } | |
| return Integer.parseInt(hostPort); |
Just some small refactoring
Description
This PR support custom SSH port for KVM hosts from the host url while adding the host and the configuration 'kvm.host.discovery.ssh.port'. The port is used during
Types of changes
Feature/Enhancement Scale or Bug Severity
Feature/Enhancement Scale
Bug Severity
Screenshots (if appropriate):
How Has This Been Tested?
How did you try to break this feature and the system with this change?